#!/bin/sh
#
# An example hook script to make use of push options.
# The example simply echoes all push options that start with 'echoback='
# and rejects all pushes when the "reject" push option is used.
#
# To enable this hook, rename this file to "pre-receive".
GIT_BRANCH=`git branch |grep \*|awk '{print $2}'`
if [ "$GIT_BRANCH" = 'deploy' ];then
	#curl http://mpe.dasu123.inet/publish.php
	ssh monda@172.28.1.3 "cd /var/www/dasu123.com/ &&sudo chown -R monda:www-data ./.*&&sudo chmod -R g+w ./.* &&exit"
	php -f /php/dasu123.com/.git/hooks/mail.php
else
	echo "here is $GIT_BRANCH"
fi
